home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dragonball-kart.swf / scripts / frame_7 / DoAction.as
Encoding:
Text File  |  2011-10-17  |  1.1 KB  |  55 lines

  1. trace("stage " + _root.stage);
  2. _root.chara = [0,0,0,0,0];
  3. _root.boil = [0,0,0,0,0];
  4. _root.nowchar = 0;
  5. _root.skor = [0,0,0,0,0];
  6. i = 1;
  7. while(i <= 4)
  8. {
  9.    _root["a" + i].gotoAndStop(i);
  10.    _root["w" + i].gotoAndStop(2);
  11.    _root["w" + i].code = i;
  12.    _root["w" + i].onRollOver = function()
  13.    {
  14.       _root.efek.attachSound("click");
  15.       _root.efek.setVolume(100);
  16.       _root.efek.start();
  17.       this.gotoAndStop(1);
  18.    };
  19.    _root["w" + i].onRollOut = function()
  20.    {
  21.       this.gotoAndStop(2);
  22.    };
  23.    _root["w" + i].onRelease = function()
  24.    {
  25.       _root.nowchar = this.code;
  26.       _root.chara[this.code] = 1;
  27.       _root.boil[1] = this.code;
  28.       j = 2;
  29.       while(j <= 4)
  30.       {
  31.          ok = 0;
  32.          do
  33.          {
  34.             r = random(4) + 1;
  35.             if(_root.chara[r] != 1)
  36.             {
  37.                _root.chara[r] = 1;
  38.                _root.boil[j] = r;
  39.                ok = 1;
  40.             }
  41.          }
  42.          while(ok != 1);
  43.          
  44.          j++;
  45.       }
  46.       ll = 1;
  47.       while(ll <= 4)
  48.       {
  49.          ll++;
  50.       }
  51.       _root.gotoAndStop("ploy");
  52.    };
  53.    i++;
  54. }
  55.